<template>
	<el-dialog title="调用信息" :visible.sync="visible" width="800px" :center="false">
		<div slot="title" class="dialog-header-title">
			<!-- <i class="el-icon-upload" style="color: #FFF"></i>&nbsp; -->
			<span style="color: #FFF">调用信息</span>
		</div>

		<div class="smp-result smp_panel">
			<!-- <div class="smp_panel_header">
				<div class="smp_panel_pre"></div>
				<div class="smp_panel_title">调用信息</div>
				<!-- <div class="smp-panel_option">
					<el-button size="mini" plain type="success" @click="exportSelect"><i class="el-icon-download"></i>
						&nbsp;导&nbsp;&nbsp;&nbsp;&nbsp;出&nbsp;</el-button>
					<el-button size="mini" plain type="success" @click="exportAll" :disabled="exportAllDisable"><i
							class="el-icon-download"></i>导出全部</el-button>
				</div> 
			</div> -->
			<div class="smp_panel_body">
				<el-table :data="list" size="mini" stripe style="width: 100%">
					<el-table-column prop="pubSysCode" label="消费系统" align="center" >
						<template slot-scope="scope">
							{{scope.row.pubSysCode|getSystemName}}
						</template>
					</el-table-column>
					<el-table-column prop="pubCode" label="服务编码(P)" align="center" />
					<el-table-column prop="busCode" label="服务编码(R)" align="center" />
					<el-table-column prop="transCode" label="交易码" align="center" />
				</el-table>

		
				<div class="smp-pagination" v-show="total>0">
					<el-pagination background size="medium" layout="total,sizes,prev, pager, next,jumper"
						:page-size="query.pageSize" :page-sizes="[5,10,15,20]" :total="total"
						:current-page="query.pageNum" @current-change="currentChange" @size-change="sizeChange">
					</el-pagination>
				</div>
			</div>
		</div>
		<span slot="footer" class="dialog-footer">
			<el-button @click="visible = false" size="mini">关 闭</el-button>
		</span>
	</el-dialog>
</template>
<script>
	import {
		getConsumeInfoByQmsNo
	} from '@/api/service.js';
	
	export default {
		data() {
			return {
				visible: false,
				total: 0,
				/* fileList: [], */
				query: {
					body: {
						associatedRequirement:'',
						batchNum:''
					},
					pageNum: 1,
					pageSize: 5
				},
				list: [],
			}

		},
		
		/* created(){
			this.getConsumeInfoByQmsNo();
		}, */
		
		methods: {
			
			getConsumeInfoByQmsNo() {
				getConsumeInfoByQmsNo(this.query).then(response => {
					this.list = response.data.extend.list;
					this.visible = true;
				})
			},
			
			ShowDialog(row) { 
				this.list = [];
				this.query.body.associatedRequirement = row.qmsNo;
				this.query.body.batchNum = row.batchNum;
				this.getConsumeInfoByQmsNo();
			},
			
			currentChange(val) {
				this.query.pageNum = val;
				this.getConsumeInfoByQmsNo();
			},
			
			sizeChange(val) {
				this.query.pageSize = val;
				this.query.pageNum = 1;
				this.getConsumeInfoByQmsNo();
			}
			
		}
	};
</script>
